llama-server supports several speculative decoding implementations. A draft model can also be combined with a draftless implementation — when combined, the draftless type takes precedence.
Implementations
- Draft model
- ngram-simple
- ngram-map-k
- ngram-map-k4v
- ngram-mod
- ngram-cache
Draft model (draft)
A small secondary model (the draft model) generates candidate tokens that the main model then verifies in a batch. This is the most widely used speculative decoding approach and works well across all kinds of content.When to use: general-purpose acceleration where a suitable small draft model exists for your target model family.--model-draft— path to the draft model GGUF--draft-max/--draft— maximum tokens to draft per step (default: 16)--draft-min— minimum draft length before the main model verifies--draft-p-min— minimum probability threshold for greedy draft selection (default: 0.8)
Key command-line flags
--spec-type values
Statistics output
Each speculative decoding implementation prints statistics at the end of each request. Use them to tune your configuration. Draft model + ngram-simple combined:
A high
#acc tokens / #gen tokens ratio means your draft configuration is well-suited to the content. If the ratio is low, try a different --spec-type, adjust --spec-ngram-size-n, or reduce --draft-max.